package models

// 1.获取用户信息
func UserJson(userMod *User) map[string]interface{} {
	var LoginJosn map[string]interface{}
	LoginJosn = make(map[string]interface{})
	LoginJosn["id"] = userMod.Id
	LoginJosn["name"] = userMod.Name
	LoginJosn["theme_id"] = userMod.ThemeId
	LoginJosn["theme_path"] = userMod.ThemePath
	LoginJosn["phone"] = userMod.Phone
	LoginJosn["email"] = userMod.Email
	LoginJosn["avatar"] = userMod.Avatar
	LoginJosn["role_id"] = userMod.RoleId
	LoginJosn["check_status"] = userMod.CheckStatus
	LoginJosn["department"] = userMod.Department
	LoginJosn["department_id"] = userMod.DepartmentId
	LoginJosn["register_type"] = userMod.RegisterType
	LoginJosn["create_at"] = userMod.CreateAt
	LoginJosn["create_by"] = userMod.CreateBy
	LoginJosn["update_at"] = userMod.UpdateAt
	LoginJosn["update_by"] = userMod.UpdateBy
	return LoginJosn
}

// 2.图片文件数据库表json结构
func ImageResourceJson(resourceLib *ImageResource) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["auther"] = resourceLib.Auther
	ResJosn["path"] = resourceLib.Path
	ResJosn["thumb"] = resourceLib.Thumb
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["res_fomat"] = resourceLib.ResFomat
	ResJosn["is_delete"] = resourceLib.IsDelete
	ResJosn["pv"] = resourceLib.Pv
	ResJosn["create_name"] = resourceLib.CreateName
	ResJosn["update_name"] = resourceLib.UpdateName
	return ResJosn
}

// 2.视频文件数据库表json结构
func VideoResourceJson(resourceLib *VideoResource) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["auther"] = resourceLib.Auther
	ResJosn["path"] = resourceLib.Path
	ResJosn["title"] = resourceLib.Title
	ResJosn["thumb"] = resourceLib.Thumb
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["res_fomat"] = resourceLib.ResFomat
	ResJosn["is_delete"] = resourceLib.IsDelete
	ResJosn["pv"] = resourceLib.Pv
	ResJosn["create_name"] = resourceLib.CreateName
	ResJosn["update_name"] = resourceLib.UpdateName
	return ResJosn
}

// 3.项目数据库表JSON结构
func ProjectLibsJson(resourceLib *Project) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["background"] = resourceLib.Background
	ResJosn["target"] = resourceLib.Target
	ResJosn["parent_id"] = resourceLib.ParentId
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["status"] = resourceLib.Status
	ResJosn["check_status"] = resourceLib.CheckStatus
	ResJosn["mark"] = resourceLib.Mark
	ResJosn["edit_by"] = resourceLib.EditBy
	ResJosn["submit_log"] = resourceLib.SubmitLog
	ResJosn["check_log"] = resourceLib.CheckLog
	ResJosn["edit_flag"] = resourceLib.EditFlag
	return ResJosn
}

// 4.项目-场景信息
func ProjectSceneJson(resourceLib *ProjectScene) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["project_id"] = resourceLib.ProjectId
	ResJosn["scene_id"] = resourceLib.SceneId
	return ResJosn
}

func ProjectFileJson(resourceLib *ProjectFile) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["project_id"] = resourceLib.ProjectId
	ResJosn["file_id"] = resourceLib.FileId
	return ResJosn
}

// 5.场景信息json格式
func SceneLibsJson(resourceLib *Scene) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["scene_id"] = resourceLib.SceneId
	ResJosn["icon_name"] = resourceLib.IconName
	ResJosn["participant"] = resourceLib.Participant
	ResJosn["cover_image_id"] = resourceLib.CoverImageId
	ResJosn["cover_image_thumb"] = resourceLib.CoverImageThumb
	ResJosn["cover_image_path"] = resourceLib.CoverImagePath
	ResJosn["parent_id"] = resourceLib.ParentId
	ResJosn["defect"] = resourceLib.Defect
	ResJosn["advance"] = resourceLib.Advance
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["author"] = resourceLib.Author
	ResJosn["check_status"] = resourceLib.CheckStatus
	ResJosn["version_status"] = resourceLib.VersionStatus
	ResJosn["check_log"] = resourceLib.CheckLog
	ResJosn["version"] = resourceLib.Version
	ResJosn["pv"] = resourceLib.Pv
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["update_name"] = resourceLib.UpdateName
	ResJosn["create_name"] = resourceLib.CreateName
	ResJosn["show_element"] = resourceLib.ShowElement
	ResJosn["show_advance"] = resourceLib.ShowAdvance
	ResJosn["show_describe"] = resourceLib.ShowDescribe
	ResJosn["show_image"] = resourceLib.ShowImage
	ResJosn["show_video"] = resourceLib.ShowVideo
	ResJosn["show_scene"] = resourceLib.ShowScene
	ResJosn["show_defect"] = resourceLib.ShowDefect
	ResJosn["default_edit_by"] = resourceLib.DefaultEditBy
	ResJosn["edit_by"] = resourceLib.EditBy
	ResJosn["edit_flag"] = resourceLib.EditFlag
	ResJosn["submit_log"] = resourceLib.SubmitLog
	return ResJosn
}

// 文件资源
func FileResourceJson(resourceLib *FileResource) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["auther"] = resourceLib.Auther
	ResJosn["path"] = resourceLib.Path
	ResJosn["title"] = resourceLib.Title
	ResJosn["thumb"] = resourceLib.Thumb
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["res_fomat"] = resourceLib.ResFomat
	ResJosn["create_name"] = resourceLib.CreateName
	ResJosn["update_name"] = resourceLib.UpdateName
	return ResJosn
}

// 场景-图片转换json格式、
func ScentImageResourceJson(resourceLib *SceneRelateImage) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["scene_id"] = resourceLib.SceneId
	ResJosn["file_id"] = resourceLib.FileId
	return ResJosn
}

// 场景-视频转换json格式、
func ScentVideoResourceJson(resourceLib *SceneRelateVideo) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["scene_id"] = resourceLib.SceneId
	ResJosn["file_id"] = resourceLib.FileId
	return ResJosn
}

// 场景-场景转换json格式、
func ScentSceneResourceJson(resourceLib *SceneRelateScene) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["scene_id"] = resourceLib.SceneId
	ResJosn["relate_scene_id"] = resourceLib.RelateSceneId
	return ResJosn
}

// 场景-元素转换json格式、
func ScentSceneElementResourceJson(resourceLib *SceneRelateElement) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["scene_id"] = resourceLib.SceneId
	ResJosn["element_id"] = resourceLib.ElementId
	return ResJosn
}

// c场景元素转换json格式、
func ElementJson(resourceLib *Element) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["pin_yin"] = resourceLib.PinYin
	ResJosn["status"] = resourceLib.Status
	ResJosn["parent_id"] = resourceLib.ParentId
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["update_name"] = resourceLib.UpdateName
	ResJosn["create_name"] = resourceLib.CreateName
	return ResJosn
}

// 主题theme
func ThemeJson(resourceLib *Theme) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["use_state"] = resourceLib.UseState
	ResJosn["image_id"] = resourceLib.ImageId
	return ResJosn
}

// 背景图片
func PerferenceImageJson(resourceLib *PreferenceImage) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["image_id"] = resourceLib.ImageId
	return ResJosn
}

// 系统设置
// c场景元素转换json格式、
func SystemsJson(resourceLib *Systems) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["mode"] = resourceLib.Mode
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["update_name"] = resourceLib.UpdateName
	ResJosn["create_name"] = resourceLib.CreateName
	return ResJosn
}

// 日志json格式
func LoggersJson(resourceLib *Loggers) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["module"] = resourceLib.Module
	ResJosn["log_time"] = resourceLib.LogTime
	ResJosn["version"] = resourceLib.Version
	ResJosn["action"] = resourceLib.Action
	ResJosn["auther"] = resourceLib.Auther
	return ResJosn
}

// 部门列表
func DepartmentJson(resourceLib *Department) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["parent_id"] = resourceLib.ParentId
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["update_name"] = resourceLib.UpdateName
	ResJosn["create_name"] = resourceLib.CreateName
	return ResJosn
}

// c场景元素转换json格式、
func RoleJson(resourceLib *Role) map[string]interface{} {
	var ResJosn map[string]interface{}
	ResJosn = make(map[string]interface{})
	ResJosn["id"] = resourceLib.Id
	ResJosn["title"] = resourceLib.Title
	ResJosn["describe"] = resourceLib.Describe
	ResJosn["create_by"] = resourceLib.CreateBy
	ResJosn["create_at"] = resourceLib.CreateAt
	ResJosn["update_by"] = resourceLib.UpdateBy
	ResJosn["update_at"] = resourceLib.UpdateAt
	ResJosn["update_name"] = resourceLib.UpdateName
	ResJosn["create_name"] = resourceLib.CreateName
	return ResJosn
}
